<?php

namespace app\api\model;


use QRcode;
use think\facade\Db;
use function DI\string;

class Common
{

    /**
     * 获取参数值
     * @param $code
     * @return array|mixed
     */
    public static function config($code)
    {
        $parr = Db::name("config_data")->column('value', 'code');
        $arr = [];
        if (is_array($code)) {
            foreach ($code as $value) {
                $arr[$value] = $parr[$value];
            }
        } else {
            $arr = Db::name("config_data")->where('code', $code)->value('value');
        }
        return $arr;
    }
}